using UnityEngine;

[CreateAssetMenu(menuName = "Alive Person Character")]
public class AlivePersonCharacter : ZombieCharacteristic
{
	private ZombieInHome sceneZombie;

	public override void OnStartZombie(ZombieInHome zombie)
	{
		base.OnStartZombie(zombie);
		sceneZombie = zombie;
		zombie.soundsRage = new AudioClip[0];
		zombie.soundsPain = new AudioClip[0];
		zombie.soundsDie = new AudioClip[0];
		for (int i = 0; i < zombie.areas.Length; i++)
		{
			zombie.areas[i].AddComponentListener<DestroyBodyJoints>(OnDestroyBodyJoints);
		}
	}

	public override EntityBehaviour GetBehaviour(ZombieInHome zombie)
	{
		return new AlivePersonBehaviour(zombie);
	}

	public void OnDestroyBodyJoints(DestroyBodyJoints compJointsBody)
	{
		sceneZombie.Death();
	}
}
